package computer;

public class LongWord implements Word {
	private long value;
	
	public LongWord(long value) {
		this.value = value;
	}
	
	public boolean equals(Memory memory, Operand operand) {
		return ((LongWord)operand.getValue(memory)).value == value;
	}

	public String toString() {
		return new Long(this.value).toString();
	}
	
	public long value() {
		return value;
	}
	
	public Word getValue(Memory memory) {
		return this;
	}	

	public void add(Word w1, Word w2) {
		value = ((LongWord)w1).value + ((LongWord)w2).value;
	}
	

	public void mul(Word w1, Word w2) {
		value = ((LongWord)w1).value * ((LongWord)w2).value;
	}
	
	public void copy(Word w1) {
		value = ((LongWord)w1).value;
	}
}
